#ifndef OBJECT_INSPECTOR_WINDOW
#define OBJECT_INSPECTOR_WINDOW
#include <sdk_global.h>
#include <WindowBase.h>
#include <ObjectInspector.h>
#include <ObjectInspectorDirector.h>
#include <QAction>
#include <QList>
#include <QMenu>
//看成整个树结构的接口
class QDESIGNER_SDK_EXPORT ObjectInspectorWindow : public WindowBase
{
    Q_OBJECT
public:
	ObjectInspectorWindow(QWidget *parent = 0);
	virtual ~ObjectInspectorWindow();
	virtual Qt::DockWidgetArea dockWidgetArea();
    void replaceObjectInspectorModel(ObjectInspectorModel *model);
    void addDirector(QSharedPointer<ObjectInspectorDirector> director);
    void rebuild();
    void refresh();
    void clear();
    virtual QList<QAction*> getActionList();
    virtual QMenu* getWindowBaseMenu();
    QStandardItem* getCurrentItemPrt();
    QStandardItem* getRootItemPtr();
    //void beforeLoadFile();
    ObjectInspectorItem* addDown(QStandardItem* parentStandardItem,const QString& typeName);

    void hideMenuObjectInspector();
public slots:
    void actionAddUpTriggered();
    void actionAddDownTriggered();
    void actionDeleteNodeTriggered();
    void actionChangeNodeParentTriggered();
    void actionCopyNodeTriggered();
    void actionExpansionNodeTriggered();
    void actionContractNodeTriggered();
    void actionRefreshTriggered();

    void onTreeViewContextMenuRequested(const QPoint & pos);
protected:
    void selectObjItem(QStandardItem* itemPtr);
private:
	ObjectInspector* m_objectInspector;
    QList<QAction*> m_actionList;
    QMenu* m_menu;
    QMenu* m_menuPop;
};



#endif // OBJECT_INSPECTOR_WINDOW
